//78
function subsets(nums) {
  const result = [];
  function travel(arr, nums) {
    result.push(arr);
    if (nums.length === 0) {
      return;
    }
    for (let i = 0; i < nums.length; i++) {
      travel([...arr, nums[i]], nums.slice(i + 1));
    }
  }
  travel([], nums);
  return result;
}
console.log(subsets([1, 2, 3]));
console.log(1);
